export default function createElement(type, props, ...children) {
  const childs = [].concat(...children).reduce((result, current) => {
    if (current !== false && current !== true && current !== null) {
      if (current instanceof Object) {
        result.push(current)
      } else {
        result.push(createElement('text', {textContent: current}))
      }
    }
    return result
  }, [])

  // console.log(...children)
  return {
    type,
    props: Object.assign({children: childs}, props),
    children: childs
  }
}